package com.llmcu.source.mybatisplus.officialsample.quickstart.controller;

import com.llmcu.source.mybatisplus.officialsample.quickstart.entity.SysUser;
import com.llmcu.source.mybatisplus.officialsample.quickstart.mapper.SysUserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * xxxx
 *
 * @author liuling
 * @date 2024/12/12 22:16
 */
@RestController
@RequestMapping("user")
public class UserController {
    @Autowired
    private SysUserMapper sysUserMapper;
    @GetMapping("hello")
    public String sayHello(){
        List<SysUser> userList = sysUserMapper.selectList(null);
        SysUser user = new SysUser().setName("liuling").setAge(1);
        System.out.println(user);
        userList.forEach(System.out::println);
        return "hello"+userList.size();
    }
}
